package com.weme.common.util

import android.app.AlertDialog
import android.content.Context
import android.view.Gravity
import android.view.WindowManager
import com.weme.common.R

class DialogExt {}
fun Context.createProgressDialog(): AlertDialog {
    return AlertDialog.Builder(this)
        .setView(R.layout.progress_dialog_layout) // 替换为你自己的布局文件
        .setCancelable(false)
        .create()
        .apply {
            window?.apply {
                setBackgroundDrawableResource(android.R.color.transparent)
                setLayout(
                    WindowManager.LayoutParams.MATCH_PARENT ,
                    WindowManager.LayoutParams.MATCH_PARENT
                )
                setGravity(Gravity.CENTER) // 确保居中
            }
        }
}

